package com.cynen.service.impl;

import com.cynen.dao.ItemDao;
import com.cynen.pojo.Item;
import com.cynen.service.ItemService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Example;
import org.springframework.stereotype.Service;
import java.util.List;


@Service
public class ItemServiceImpl implements ItemService {

    @Autowired
    private ItemDao itemDao;

    @Override
    public void save(Item item) {
        this.itemDao.save(item);
    }

    @Override
    public List<Item> findAll(Item item) {
        Example<Item> example = Example.of(item);

        // 根据条件查询.
        return  itemDao.findAll(example);
    }
}
